package com.zhang.backend.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("persons") // 替换 @Entity 和 @Table
public class Person {

    @TableId(value = "person_id", type = IdType.AUTO)
    private Long personId;

    @TableField("family_id")
    private Long familyId;

    @TableField("name")
    private String name;

    @TableField("gender")
    private Character gender;

    @TableField("birth_date")
    private LocalDate birthDate;

    @TableField("death_date")
    private LocalDate deathDate;

    @TableField("is_deleted")
    private Boolean isDeleted;
}